//package com.chenyun.system.controller;
//
//import cn.hutool.core.collection.CollectionUtil;
//import com.chenyun.boot.bms.feign.IMerchantInfoFeign;
//import com.chenyun.system.model.SysMerchantMenu;
//import com.chenyun.system.service.ISysMerchantMenuService;
//import com.chenyun.system.vo.TreeSelect;
//import com.chenyun.common.utils.StringUtils;
//import com.chenyun.common.vo.AjaxResult;
//import io.swagger.annotations.Api;
//import io.swagger.annotations.ApiOperation;
//import org.springframework.context.annotation.Lazy;
//
//import javax.annotation.Resource;
//import java.util.ArrayList;
//import java.util.List;
//
//
///**
// * 平台端-商户管理-admin
// *
// * @author: Lonni
// */
//@RestController
//@RequestMapping("plat/merchant")
//@Api(tags = "平台端-商户管理-admin")
//public class MerchantController {
//
//    @Resource
//    private ISysMerchantMenuService merchantMenuService;
//    @Resource
//    @Lazy
//    private IMerchantInfoFeign merchantInfoFeign;
//
//    @ApiOperation("为商户设置菜单")
//    @PostMapping("addMenu/{merType}")
//    public AjaxResult<Boolean> createMerchantMenu(@RequestBody List<String> menuIds, @PathVariable("merType") Integer merType) {
//        if (CollectionUtil.isEmpty(menuIds)) {
//            return AjaxResult.FAIL("菜单数据不能为空!");
//        }
//        if (StringUtils.isNull(merType)) {
//            return AjaxResult.FAIL("商户类型不能为空!");
//        }
//        List<SysMerchantMenu> merchantMenus = new ArrayList<>();
//        menuIds.forEach(p -> {
//            merchantMenus.add(SysMerchantMenu.builder()
//                    .menuId(Long.valueOf(p))
//                    .merType(merType)
//                    .build());
//        });
//        Boolean aBoolean = merchantMenuService.addMerchantMenu(merchantMenus);
//        return aBoolean ? AjaxResult.SUCCESS(aBoolean) : AjaxResult.FAIL();
//    }
//
//    @ApiOperation("根据商户类型获取权限菜单")
//    @PostMapping("getMenu/{merType}")
//    public AjaxResult<List<SysMerchantMenu>> getMerchantMenuByType(@PathVariable("merType") Integer merType) {
//        List<SysMerchantMenu> merchantMenuByType = merchantMenuService.getMerchantMenuByType(merType);
//        return AjaxResult.SUCCESS(merchantMenuByType);
//    }
//
//    @PostMapping("getMenuTree/{merType}")
//    @ApiOperation("根据商户类型获取权限菜单(树形结构)")
//    public AjaxResult<List<TreeSelect>> getMerchantMenuTree(@PathVariable("merType") Integer merType) {
//        List<TreeSelect> list = merchantMenuService.getMerchantMenuTreeSelectByType(merType);
//        return AjaxResult.SUCCESS(list);
//    }
//
////    @Log(title = "审核店铺", businessType = BusinessTypeEnum.UPDATE,
////            desc = "'审核店铺信息编号为['+#process.id+']的数据,审核状态为['+#process.processType+']'")
////    @PostMapping("processShop")
////    @ApiOperation("审核店铺")
////    public AjaxResult processMerchant(@RequestBody @Validated BmsShopProcess process) {
////        ServiceResponse<Integer> response = merchantInfoFeign.processShop(process);
////        if (response.getSuccess() && response.getData() > 0) {
////            return AjaxResult.SUCCESS();
////        } else {
////            return AjaxResult.FAIL(response.getMsg(), response.getData());
////        }
////
////    }
////
////
////    @PostMapping("processList")
////    @ApiOperation("审核店铺列表")
////    public AjaxResult processMerchant(@RequestParam(SysConstants.PAGE_NUM) Integer pageNum,
////                                      @RequestParam(SysConstants.PAGE_SIZE) Integer pageSize,
////                                      @RequestBody BmsShopProcess process) {
////        ServiceResponse<List<BmsShopProcess>> listServiceResponse = merchantInfoFeign.processList(pageNum, pageSize, process);
////        return AjaxResult.buildServiceResponse(listServiceResponse);
////
////    }
//}
//
//
//
